-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use engine flox for ordered groups #266
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this!
so the engine detection should be done in a separate function and then we can test this function
Yes!
I only determine the engine in groupby_reduce however it is already accessed in xarray_reduce - this is not optimal (see below)
Yes a helper function will fix this. xarray_reduce
can jsut call that.
flox/core.py
Outdated
@@ -1755,7 +1755,7 @@ def groupby_reduce( | |||
dtype: np.typing.DTypeLike = None, | |||
min_count: int | None = None, | |||
method: T_Method = "map-reduce", | |||
engine: T_Engine = "numpy", | |||
engine: T_Engine = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a docstring update.
flox/xarray.py
Outdated
@@ -72,7 +72,7 @@ def xarray_reduce( | |||
fill_value=None, | |||
dtype: np.typing.DTypeLike = None, | |||
method: str = "map-reduce", | |||
engine: str = "numpy", | |||
engine: str = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again needs docstring update.
Thanks for the feedback. I have to let this rest until I find some time again - so feel free to take this over if anyone is interested. |
* upstream/main: Support quantile, median, mode with method="blockwise". (xarray-contrib#269) Add multidimensional binning demo (xarray-contrib#203) [pre-commit.ci] pre-commit autoupdate (xarray-contrib#268) Drop python 3.8, test python 3.11 (xarray-contrib#209) tests: move xfail out of functions (xarray-contrib#265) Bump actions/checkout from 3 to 4 (xarray-contrib#267)
* upstream/main: Add engine="numbagg" (xarray-contrib#72)
* main: repo-review comments (xarray-contrib#270)
I hardly qualify to be on here 😅 thanks for finishing up - this will be a huge win! |
* main: (24 commits) Add `packaging` as dependency use engine flox for ordered groups (#266) Update pyproject.toml: py3.12 Bump numpy to >=1.22 (#278) Cleanups (#276) benchmarks updates (#273) repo-review comments (#270) Significantly faster cohorts detection. (#272) Add engine="numbagg" (#72) Support quantile, median, mode with method="blockwise". (#269) Add multidimensional binning demo (#203) [pre-commit.ci] pre-commit autoupdate (#268) Drop python 3.8, test python 3.11 (#209) tests: move xfail out of functions (#265) Bump actions/checkout from 3 to 4 (#267) convert datetime: micro-optimizations (#261) compatibility with `numpy>=2.0` (#257) replace the deprecated `provision-with-micromamba` with `setup-micromamba` (#258) Fix some typing errors in asv_bench and tests (#253) [pre-commit.ci] pre-commit autoupdate (#250) ...
Set
engine=None
and selectengine="flox"
for ordered groups. Some commentsgroupby_reduce
however it is already accessed inxarray_reduce
- this is not optimal (see below)flox/flox/xarray.py
Line 367 in 5ea713e